var componentToolbarAddressBasePath = componentAddressBasePath+"/dhtmlxToolbar_pro";
var themeToolbarAddressBasePath = componentToolbarAddressBasePath;
if(themeAddr != '1'){ 
	themeToolbarAddressBasePath = 'theme/'+themeAddr+'/dhtmlx-style';
}
document.write('<link rel="stylesheet" type="text/css" href="'+themeToolbarAddressBasePath+'/skins/dhtmlxtoolbar_dhx_'+getThemeAddrSuffix()+'.css">');
document.write('<script type="text/javascript" src="'+componentAddressBasePath+'/dhtmlxcommon.js"></script>');
document.write('<script type="text/javascript" src="'+componentToolbarAddressBasePath+'/dhtmlxtoolbar.js"></script>');

function setToolbarIconsPath(toolbar){
	toolbar.setIconsPath("theme/toolbarImgs/");
}

function setToolbarSkin(toolbar,skin){
	toolbar.setSkin(skin || ("dhx_"+ getThemeAddrSuffix() ));
}


function createToolbarFromDHXLayoutCell(cell,operateToolbar){
	var toolbar = cell.attachToolbar();
	configToolbar(toolbar,operateToolbar);
}
function createToolbarFromDHXLayout(layout,cell,operateToolbar){
	var toolbar = layout.cells(cell).attachToolbar();
	configToolbar(toolbar,operateToolbar);
}

function configToolbar(toolbar,operateToolbar){
	setToolbarIconsPath(toolbar);
	operateToolbar(toolbar);
}

function createToolbar(divid){
	var toolbar = new dhtmlXToolbarObject(divid);
	setToolbarIconsPath(toolbar);
	setToolbarSkin(toolbar);
    return toolbar;
}